package io.simple.sessions;

import io.simple.core.RequestContext;

/**
 * Created by rehak on 2/25/14.
 */
public interface Sessions {

    public static final String SESSION_PROP_NAME = "io.simple.sessions.Sessions.SESSION-ID";

    /**
     * Get session object for given ID
     *
     * @param id
     * @return
     */
    public Session get(String id);

    /**
     * Get session object for request context
     *
     * @param ctx
     * @return
     */
    public Session get(RequestContext ctx);

    /**
     * Create session
     *
     * @return
     */
    public Session create();

    /**
     * Recreates session with supplied ID
     *
     * @return
     */
    public Session recreate(String id);

    /**
     * Refresh session (e.g. prolong session life)
     */
    public void refresh(Session session);

    public void remove(Session session);

    public void remove(String id);

}
